package com.ktjy.goods.controller;


import  com.ktjy.common.core.domain.AjaxResult;
import com.ktjy.common.core.domain.entity.SysDept;
import com.ktjy.goods.domain.TGoodsCategory;
import com.ktjy.goods.service.ITGoodsCategoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-03-15
 */
@RestController
@RequestMapping("/goods/tGoodsCategory")
public class TGoodsCategoryController {

    private static final Logger log = LoggerFactory.getLogger(TGoodsCategoryController.class);
    @Autowired
    private ITGoodsCategoryService goodsCategoryService;

    /**
     * 获取对应角色部门树列表
     */
//    @PreAuthorize("@ss.hasPermi('goods:tGoodsCategory:goodsTree')")
//    @GetMapping(value = "/goodsTree")
//    public AjaxResult goodsTree()
//    {
//        System.out.println("12312312312321");
//        AjaxResult ajax = AjaxResult.success();
//        ajax.put("cateGory", goodsCategoryService.getCategoryTree());
//        System.out.println(goodsCategoryService.getCategoryTree());
//        return ajax;
//    }

    @PreAuthorize("@ss.hasPermi('goods:tGoodsCategory:goodsTree')")
    @GetMapping(value = "/goodsTree")
    public List<TGoodsCategory> getCategoryTree() {
        return goodsCategoryService.getCategoryTree();
    }
}
